﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //' Retrieve the company name from the appropriate cell.
            //Dim companyName As String = CustomersGridView.SelectedRow.Cells(2).Text
            string latitudeStr = GridView1.SelectedRow.Cells[2].Text;
            string longitudeStr = GridView1.SelectedRow.Cells[3].Text;
            
            //http://localhost:48507/TrackingMap.aspx?latitude=-20.3550483333333&longitude=-40.28837
            //./TrackingMap.aspx?latitude=-40.28837&longitude=-20.3550483333333

            //' Display company name selected by the user.
            //Message.Text = "You selected " & companyName & "."

            //Response.Redirect("./map.aspx?latitude=" + latitudeStr.Replace(",",".") + "&" + "longitude=" + longitudeStr.Replace(",","."));
            Response.Redirect("./TrackingMap.aspx?latitude=" + latitudeStr.Replace(",", ".") + "&" + "longitude=" + longitudeStr.Replace(",", "."));
            //./TrackingMap.aspx?latitude=-20.3552333333333&longitude=-40.28822

            // http://localhost:58159/MERCATOR_Portal/Forms/Veiculo/Edit.aspx?VeiculoID=6044
            // http://localhost:58159/MERCATOR_Portal/Forms/Veiculo/List.aspx
            //http://www.lifeware.com.br/Mercatorportal/Forms/Veiculo/List.aspx

            //Device.aspx?field={0}

        }
    }
}
